{
    "cells": [
        {
            "cell_type": "markdown",
            "metadata": {},
            "source": [
                "# MGM数据集"
            ]
        },
        {
            "cell_type": "markdown",
            "metadata": {},
            "source": [
                "## Mondrian"
            ]
        },
        {
            "cell_type": "code",
            "execution_count": 1,
            "metadata": {},
            "outputs": [
                {
                    "name": "stdout",
                    "output_type": "stream",
                    "text": [
                        "----------------------------------------------------------------------------------------------------------\n",
                        "Namespace(anonymity=50, anonymity_method='mondrian', dataset='mgm', experiment='Y', model='lr')\n",
                        "----------------------------------------------------------------------------------------------------------\n",
                        "LogisticRegression(max_iter=1000)\n",
                        "baseline: acc=0.8715, precision=0.8725, recall=0.8710, f1=0.8712\n",
                        "----------------------------------------------------------------------------------------------------------\n",
                        "K = 2\n",
                        "匿名化数据已存在, 直接开始机器学习实验\n",
                        "acc=0.8394, precision=0.8395, recall=0.8396, f1=0.8394\n",
                        "----------------------------------------------------------------------------------------------------------\n",
                        "K = 5\n",
                        "匿名化数据已存在, 直接开始机器学习实验\n",
                        "acc=0.8233, precision=0.8291, recall=0.8219, f1=0.8220\n",
                        "----------------------------------------------------------------------------------------------------------\n",
                        "K = 10\n",
                        "匿名化数据已存在, 直接开始机器学习实验\n",
                        "acc=0.8072, precision=0.8086, recall=0.8065, f1=0.8067\n",
                        "----------------------------------------------------------------------------------------------------------\n",
                        "K = 15\n",
                        "匿名化数据已存在, 直接开始机器学习实验\n",
                        "acc=0.7952, precision=0.7976, recall=0.7942, f1=0.7943\n",
                        "----------------------------------------------------------------------------------------------------------\n",
                        "K = 20\n",
                        "匿名化数据已存在, 直接开始机器学习实验\n",
                        "acc=0.8032, precision=0.8042, recall=0.8026, f1=0.8028\n",
                        "----------------------------------------------------------------------------------------------------------\n",
                        "K = 25\n",
                        "匿名化数据已存在, 直接开始机器学习实验\n",
                        "acc=0.7751, precision=0.7769, recall=0.7742, f1=0.7743\n",
                        "----------------------------------------------------------------------------------------------------------\n",
                        "K = 30\n",
                        "匿名化数据已存在, 直接开始机器学习实验\n",
                        "acc=0.7751, precision=0.7769, recall=0.7742, f1=0.7743\n",
                        "----------------------------------------------------------------------------------------------------------\n",
                        "K = 35\n",
                        "匿名化数据已存在, 直接开始机器学习实验\n",
                        "acc=0.7751, precision=0.7769, recall=0.7742, f1=0.7743\n",
                        "----------------------------------------------------------------------------------------------------------\n",
                        "K = 40\n",
                        "匿名化数据已存在, 直接开始机器学习实验\n",
                        "acc=0.7751, precision=0.7769, recall=0.7742, f1=0.7743\n",
                        "----------------------------------------------------------------------------------------------------------\n",
                        "K = 45\n",
                        "匿名化数据已存在, 直接开始机器学习实验\n",
                        "acc=0.7751, precision=0.7769, recall=0.7742, f1=0.7743\n",
                        "----------------------------------------------------------------------------------------------------------\n",
                        "K = 50\n",
                        "匿名化数据已存在, 直接开始机器学习实验\n",
                        "acc=0.7751, precision=0.7769, recall=0.7742, f1=0.7743\n",
                        "----------------------------------------------------------------------------------------------------------\n",
                        "K = 55\n",
                        "匿名化数据已存在, 直接开始机器学习实验\n",
                        "acc=0.7751, precision=0.7769, recall=0.7742, f1=0.7743\n",
                        "----------------------------------------------------------------------------------------------------------\n",
                        "K = 60\n",
                        "匿名化数据已存在, 直接开始机器学习实验\n",
                        "acc=0.7108, precision=0.7113, recall=0.7112, f1=0.7108\n",
                        "----------------------------------------------------------------------------------------------------------\n",
                        "K = 65\n",
                        "匿名化数据已存在, 直接开始机器学习实验\n",
                        "acc=0.7068, precision=0.7226, recall=0.7094, f1=0.7031\n",
                        "----------------------------------------------------------------------------------------------------------\n",
                        "K = 70\n",
                        "匿名化数据已存在, 直接开始机器学习实验\n",
                        "acc=0.7068, precision=0.7226, recall=0.7094, f1=0.7031\n",
                        "----------------------------------------------------------------------------------------------------------\n",
                        "K = 75\n",
                        "匿名化数据已存在, 直接开始机器学习实验\n",
                        "acc=0.7068, precision=0.7226, recall=0.7094, f1=0.7031\n",
                        "----------------------------------------------------------------------------------------------------------\n",
                        "K = 80\n",
                        "匿名化数据已存在, 直接开始机器学习实验\n",
                        "acc=0.7068, precision=0.7226, recall=0.7094, f1=0.7031\n",
                        "----------------------------------------------------------------------------------------------------------\n",
                        "K = 85\n",
                        "匿名化数据已存在, 直接开始机器学习实验\n",
                        "acc=0.7068, precision=0.7226, recall=0.7094, f1=0.7031\n",
                        "----------------------------------------------------------------------------------------------------------\n",
                        "K = 90\n",
                        "匿名化数据已存在, 直接开始机器学习实验\n",
                        "acc=0.7068, precision=0.7226, recall=0.7094, f1=0.7031\n",
                        "----------------------------------------------------------------------------------------------------------\n",
                        "K = 95\n",
                        "匿名化数据已存在, 直接开始机器学习实验\n",
                        "acc=0.7068, precision=0.7226, recall=0.7094, f1=0.7031\n",
                        "----------------------------------------------------------------------------------------------------------\n",
                        "K = 100\n",
                        "匿名化数据已存在, 直接开始机器学习实验\n",
                        "acc=0.7068, precision=0.7226, recall=0.7094, f1=0.7031\n",
                        "----------------------------------------------------------------------------------------------------------\n",
                        "CPU times: user 8.72 s, sys: 4.53 s, total: 13.3 s\n",
                        "Wall time: 8.04 s\n"
                    ]
                }
            ],
            "source": [
                "%%time\n",
                "%run main.py --dataset mgm --anonymity_method mondrian --model lr --experiment Y "
            ]
        },
        {
            "cell_type": "code",
            "execution_count": 2,
            "metadata": {},
            "outputs": [
                {
                    "name": "stdout",
                    "output_type": "stream",
                    "text": [
                        "----------------------------------------------------------------------------------------------------------\n",
                        "Namespace(anonymity=50, anonymity_method='mondrian', dataset='mgm', experiment='Y', model='nb')\n",
                        "----------------------------------------------------------------------------------------------------------\n",
                        "GaussianNB(var_smoothing=1.0)\n",
                        "baseline: acc=0.8635, precision=0.8673, recall=0.8624, f1=0.8628\n",
                        "----------------------------------------------------------------------------------------------------------\n",
                        "K = 2\n",
                        "匿名化数据已存在, 直接开始机器学习实验\n",
                        "acc=0.8394, precision=0.8405, recall=0.8399, f1=0.8393\n",
                        "----------------------------------------------------------------------------------------------------------\n",
                        "K = 5\n",
                        "匿名化数据已存在, 直接开始机器学习实验\n",
                        "acc=0.8233, precision=0.8251, recall=0.8240, f1=0.8232\n",
                        "----------------------------------------------------------------------------------------------------------\n",
                        "K = 10\n",
                        "匿名化数据已存在, 直接开始机器学习实验\n",
                        "acc=0.8273, precision=0.8287, recall=0.8280, f1=0.8273\n",
                        "----------------------------------------------------------------------------------------------------------\n",
                        "K = 15\n",
                        "匿名化数据已存在, 直接开始机器学习实验\n",
                        "acc=0.8072, precision=0.8093, recall=0.8063, f1=0.8065\n",
                        "----------------------------------------------------------------------------------------------------------\n",
                        "K = 20\n",
                        "匿名化数据已存在, 直接开始机器学习实验\n",
                        "acc=0.8153, precision=0.8158, recall=0.8157, f1=0.8153\n",
                        "----------------------------------------------------------------------------------------------------------\n",
                        "K = 25\n",
                        "匿名化数据已存在, 直接开始机器学习实验\n",
                        "acc=0.7751, precision=0.7769, recall=0.7742, f1=0.7743\n",
                        "----------------------------------------------------------------------------------------------------------\n",
                        "K = 30\n",
                        "匿名化数据已存在, 直接开始机器学习实验\n",
                        "acc=0.7751, precision=0.7769, recall=0.7742, f1=0.7743\n",
                        "----------------------------------------------------------------------------------------------------------\n",
                        "K = 35\n",
                        "匿名化数据已存在, 直接开始机器学习实验\n",
                        "acc=0.7751, precision=0.7769, recall=0.7742, f1=0.7743\n",
                        "----------------------------------------------------------------------------------------------------------\n",
                        "K = 40\n",
                        "匿名化数据已存在, 直接开始机器学习实验\n",
                        "acc=0.7671, precision=0.7794, recall=0.7649, f1=0.7634\n",
                        "----------------------------------------------------------------------------------------------------------\n",
                        "K = 45\n",
                        "匿名化数据已存在, 直接开始机器学习实验\n",
                        "acc=0.7671, precision=0.7794, recall=0.7649, f1=0.7634\n",
                        "----------------------------------------------------------------------------------------------------------\n",
                        "K = 50\n",
                        "匿名化数据已存在, 直接开始机器学习实验\n",
                        "acc=0.7671, precision=0.7794, recall=0.7649, f1=0.7634\n",
                        "----------------------------------------------------------------------------------------------------------\n",
                        "K = 55\n",
                        "匿名化数据已存在, 直接开始机器学习实验\n",
                        "acc=0.7751, precision=0.7769, recall=0.7742, f1=0.7743\n",
                        "----------------------------------------------------------------------------------------------------------\n",
                        "K = 60\n",
                        "匿名化数据已存在, 直接开始机器学习实验\n",
                        "acc=0.7108, precision=0.7113, recall=0.7112, f1=0.7108\n",
                        "----------------------------------------------------------------------------------------------------------\n",
                        "K = 65\n",
                        "匿名化数据已存在, 直接开始机器学习实验\n",
                        "acc=0.7068, precision=0.7226, recall=0.7094, f1=0.7031\n",
                        "----------------------------------------------------------------------------------------------------------\n",
                        "K = 70\n",
                        "匿名化数据已存在, 直接开始机器学习实验\n",
                        "acc=0.7068, precision=0.7226, recall=0.7094, f1=0.7031\n",
                        "----------------------------------------------------------------------------------------------------------\n",
                        "K = 75\n",
                        "匿名化数据已存在, 直接开始机器学习实验\n",
                        "acc=0.7068, precision=0.7226, recall=0.7094, f1=0.7031\n",
                        "----------------------------------------------------------------------------------------------------------\n",
                        "K = 80\n",
                        "匿名化数据已存在, 直接开始机器学习实验\n",
                        "acc=0.7068, precision=0.7226, recall=0.7094, f1=0.7031\n",
                        "----------------------------------------------------------------------------------------------------------\n",
                        "K = 85\n",
                        "匿名化数据已存在, 直接开始机器学习实验\n",
                        "acc=0.7068, precision=0.7226, recall=0.7094, f1=0.7031\n",
                        "----------------------------------------------------------------------------------------------------------\n",
                        "K = 90\n",
                        "匿名化数据已存在, 直接开始机器学习实验\n",
                        "acc=0.7068, precision=0.7226, recall=0.7094, f1=0.7031\n",
                        "----------------------------------------------------------------------------------------------------------\n",
                        "K = 95\n",
                        "匿名化数据已存在, 直接开始机器学习实验\n",
                        "acc=0.7068, precision=0.7226, recall=0.7094, f1=0.7031\n",
                        "----------------------------------------------------------------------------------------------------------\n",
                        "K = 100\n",
                        "匿名化数据已存在, 直接开始机器学习实验\n",
                        "acc=0.7068, precision=0.7226, recall=0.7094, f1=0.7031\n",
                        "----------------------------------------------------------------------------------------------------------\n",
                        "CPU times: user 3.43 s, sys: 27.2 ms, total: 3.46 s\n",
                        "Wall time: 3.44 s\n"
                    ]
                }
            ],
            "source": [
                "%%time\n",
                "%run main.py --dataset mgm --anonymity_method mondrian --model nb --experiment Y "
            ]
        },
        {
            "cell_type": "code",
            "execution_count": 3,
            "metadata": {},
            "outputs": [
                {
                    "name": "stdout",
                    "output_type": "stream",
                    "text": [
                        "----------------------------------------------------------------------------------------------------------\n",
                        "Namespace(anonymity=50, anonymity_method='mondrian', dataset='mgm', experiment='Y', model='knn')\n",
                        "----------------------------------------------------------------------------------------------------------\n"
                    ]
                },
                {
                    "name": "stdout",
                    "output_type": "stream",
                    "text": [
                        "KNeighborsClassifier(n_neighbors=10)\n",
                        "baseline: acc=0.8594, precision=0.8626, recall=0.8585, f1=0.8589\n",
                        "----------------------------------------------------------------------------------------------------------\n",
                        "K = 2\n",
                        "匿名化数据已存在, 直接开始机器学习实验\n",
                        "acc=0.8273, precision=0.8312, recall=0.8262, f1=0.8264\n",
                        "----------------------------------------------------------------------------------------------------------\n",
                        "K = 5\n",
                        "匿名化数据已存在, 直接开始机器学习实验\n",
                        "acc=0.8153, precision=0.8223, recall=0.8137, f1=0.8137\n",
                        "----------------------------------------------------------------------------------------------------------\n",
                        "K = 10\n",
                        "匿名化数据已存在, 直接开始机器学习实验\n",
                        "acc=0.8072, precision=0.8086, recall=0.8065, f1=0.8067\n",
                        "----------------------------------------------------------------------------------------------------------\n",
                        "K = 15\n",
                        "匿名化数据已存在, 直接开始机器学习实验\n",
                        "acc=0.7952, precision=0.7976, recall=0.7942, f1=0.7943\n",
                        "----------------------------------------------------------------------------------------------------------\n",
                        "K = 20\n",
                        "匿名化数据已存在, 直接开始机器学习实验\n",
                        "acc=0.8032, precision=0.8042, recall=0.8026, f1=0.8028\n",
                        "----------------------------------------------------------------------------------------------------------\n",
                        "K = 25\n",
                        "匿名化数据已存在, 直接开始机器学习实验\n",
                        "acc=0.7751, precision=0.7769, recall=0.7742, f1=0.7743\n",
                        "----------------------------------------------------------------------------------------------------------\n",
                        "K = 30\n",
                        "匿名化数据已存在, 直接开始机器学习实验\n",
                        "acc=0.7751, precision=0.7769, recall=0.7742, f1=0.7743\n",
                        "----------------------------------------------------------------------------------------------------------\n",
                        "K = 35\n",
                        "匿名化数据已存在, 直接开始机器学习实验\n",
                        "acc=0.7751, precision=0.7769, recall=0.7742, f1=0.7743\n",
                        "----------------------------------------------------------------------------------------------------------\n",
                        "K = 40\n",
                        "匿名化数据已存在, 直接开始机器学习实验\n",
                        "acc=0.7751, precision=0.7769, recall=0.7742, f1=0.7743\n",
                        "----------------------------------------------------------------------------------------------------------\n",
                        "K = 45\n",
                        "匿名化数据已存在, 直接开始机器学习实验\n",
                        "acc=0.7751, precision=0.7769, recall=0.7742, f1=0.7743\n",
                        "----------------------------------------------------------------------------------------------------------\n",
                        "K = 50\n",
                        "匿名化数据已存在, 直接开始机器学习实验\n",
                        "acc=0.7751, precision=0.7769, recall=0.7742, f1=0.7743\n",
                        "----------------------------------------------------------------------------------------------------------\n",
                        "K = 55\n",
                        "匿名化数据已存在, 直接开始机器学习实验\n",
                        "acc=0.7751, precision=0.7769, recall=0.7742, f1=0.7743\n",
                        "----------------------------------------------------------------------------------------------------------\n",
                        "K = 60\n",
                        "匿名化数据已存在, 直接开始机器学习实验\n",
                        "acc=0.7108, precision=0.7113, recall=0.7112, f1=0.7108\n",
                        "----------------------------------------------------------------------------------------------------------\n",
                        "K = 65\n",
                        "匿名化数据已存在, 直接开始机器学习实验\n",
                        "acc=0.5743, precision=0.6900, recall=0.5662, f1=0.4864\n",
                        "----------------------------------------------------------------------------------------------------------\n",
                        "K = 70\n",
                        "匿名化数据已存在, 直接开始机器学习实验\n",
                        "acc=0.5743, precision=0.6900, recall=0.5662, f1=0.4864\n",
                        "----------------------------------------------------------------------------------------------------------\n",
                        "K = 75\n",
                        "匿名化数据已存在, 直接开始机器学习实验\n",
                        "acc=0.5100, precision=0.2550, recall=0.5000, f1=0.3378\n",
                        "----------------------------------------------------------------------------------------------------------\n",
                        "K = 80\n",
                        "匿名化数据已存在, 直接开始机器学习实验\n"
                    ]
                },
                {
                    "name": "stderr",
                    "output_type": "stream",
                    "text": [
                        "/home/user/anaconda3/envs/hhj/lib/python3.8/site-packages/sklearn/metrics/_classification.py:1471: UndefinedMetricWarning: Precision and F-score are ill-defined and being set to 0.0 in labels with no predicted samples. Use `zero_division` parameter to control this behavior.\n",
                        "  _warn_prf(average, modifier, msg_start, len(result))\n",
                        "/home/user/anaconda3/envs/hhj/lib/python3.8/site-packages/sklearn/metrics/_classification.py:1471: UndefinedMetricWarning: Precision and F-score are ill-defined and being set to 0.0 in labels with no predicted samples. Use `zero_division` parameter to control this behavior.\n",
                        "  _warn_prf(average, modifier, msg_start, len(result))\n"
                    ]
                },
                {
                    "name": "stdout",
                    "output_type": "stream",
                    "text": [
                        "acc=0.5100, precision=0.2550, recall=0.5000, f1=0.3378\n",
                        "----------------------------------------------------------------------------------------------------------\n",
                        "K = 85\n",
                        "匿名化数据已存在, 直接开始机器学习实验\n",
                        "acc=0.5100, precision=0.2550, recall=0.5000, f1=0.3378\n",
                        "----------------------------------------------------------------------------------------------------------\n",
                        "K = 90\n",
                        "匿名化数据已存在, 直接开始机器学习实验\n"
                    ]
                },
                {
                    "name": "stderr",
                    "output_type": "stream",
                    "text": [
                        "/home/user/anaconda3/envs/hhj/lib/python3.8/site-packages/sklearn/metrics/_classification.py:1471: UndefinedMetricWarning: Precision and F-score are ill-defined and being set to 0.0 in labels with no predicted samples. Use `zero_division` parameter to control this behavior.\n",
                        "  _warn_prf(average, modifier, msg_start, len(result))\n",
                        "/home/user/anaconda3/envs/hhj/lib/python3.8/site-packages/sklearn/metrics/_classification.py:1471: UndefinedMetricWarning: Precision and F-score are ill-defined and being set to 0.0 in labels with no predicted samples. Use `zero_division` parameter to control this behavior.\n",
                        "  _warn_prf(average, modifier, msg_start, len(result))\n"
                    ]
                },
                {
                    "name": "stdout",
                    "output_type": "stream",
                    "text": [
                        "acc=0.5100, precision=0.2550, recall=0.5000, f1=0.3378\n",
                        "----------------------------------------------------------------------------------------------------------\n",
                        "K = 95\n",
                        "匿名化数据已存在, 直接开始机器学习实验\n",
                        "acc=0.5100, precision=0.2550, recall=0.5000, f1=0.3378\n",
                        "----------------------------------------------------------------------------------------------------------\n",
                        "K = 100\n",
                        "匿名化数据已存在, 直接开始机器学习实验\n",
                        "acc=0.5100, precision=0.2550, recall=0.5000, f1=0.3378\n",
                        "----------------------------------------------------------------------------------------------------------\n",
                        "CPU times: user 5.59 s, sys: 990 ms, total: 6.58 s\n",
                        "Wall time: 4.26 s\n"
                    ]
                },
                {
                    "name": "stderr",
                    "output_type": "stream",
                    "text": [
                        "/home/user/anaconda3/envs/hhj/lib/python3.8/site-packages/sklearn/metrics/_classification.py:1471: UndefinedMetricWarning: Precision and F-score are ill-defined and being set to 0.0 in labels with no predicted samples. Use `zero_division` parameter to control this behavior.\n",
                        "  _warn_prf(average, modifier, msg_start, len(result))\n",
                        "/home/user/anaconda3/envs/hhj/lib/python3.8/site-packages/sklearn/metrics/_classification.py:1471: UndefinedMetricWarning: Precision and F-score are ill-defined and being set to 0.0 in labels with no predicted samples. Use `zero_division` parameter to control this behavior.\n",
                        "  _warn_prf(average, modifier, msg_start, len(result))\n"
                    ]
                }
            ],
            "source": [
                "%%time\n",
                "%run main.py --dataset mgm --anonymity_method mondrian --model knn --experiment Y "
            ]
        },
        {
            "cell_type": "code",
            "execution_count": 4,
            "metadata": {},
            "outputs": [
                {
                    "name": "stdout",
                    "output_type": "stream",
                    "text": [
                        "----------------------------------------------------------------------------------------------------------\n",
                        "Namespace(anonymity=50, anonymity_method='mondrian', dataset='mgm', experiment='Y', model='svm')\n",
                        "----------------------------------------------------------------------------------------------------------\n",
                        "LinearSVC(dual=False)\n",
                        "baseline: acc=0.8635, precision=0.8661, recall=0.8626, f1=0.8630\n",
                        "----------------------------------------------------------------------------------------------------------\n",
                        "K = 2\n",
                        "匿名化数据已存在, 直接开始机器学习实验\n",
                        "acc=0.8394, precision=0.8393, recall=0.8395, f1=0.8393\n",
                        "----------------------------------------------------------------------------------------------------------\n",
                        "K = 5\n",
                        "匿名化数据已存在, 直接开始机器学习实验\n",
                        "acc=0.8233, precision=0.8291, recall=0.8219, f1=0.8220\n",
                        "----------------------------------------------------------------------------------------------------------\n",
                        "K = 10\n",
                        "匿名化数据已存在, 直接开始机器学习实验\n",
                        "acc=0.8072, precision=0.8086, recall=0.8065, f1=0.8067\n",
                        "----------------------------------------------------------------------------------------------------------\n",
                        "K = 15\n",
                        "匿名化数据已存在, 直接开始机器学习实验\n",
                        "acc=0.7952, precision=0.7976, recall=0.7942, f1=0.7943\n",
                        "----------------------------------------------------------------------------------------------------------\n",
                        "K = 20\n",
                        "匿名化数据已存在, 直接开始机器学习实验\n",
                        "acc=0.8032, precision=0.8042, recall=0.8026, f1=0.8028\n",
                        "----------------------------------------------------------------------------------------------------------\n",
                        "K = 25\n",
                        "匿名化数据已存在, 直接开始机器学习实验\n",
                        "acc=0.7751, precision=0.7769, recall=0.7742, f1=0.7743\n",
                        "----------------------------------------------------------------------------------------------------------\n",
                        "K = 30\n",
                        "匿名化数据已存在, 直接开始机器学习实验\n",
                        "acc=0.7751, precision=0.7769, recall=0.7742, f1=0.7743\n",
                        "----------------------------------------------------------------------------------------------------------\n",
                        "K = 35\n",
                        "匿名化数据已存在, 直接开始机器学习实验\n",
                        "acc=0.7751, precision=0.7769, recall=0.7742, f1=0.7743\n",
                        "----------------------------------------------------------------------------------------------------------\n",
                        "K = 40\n",
                        "匿名化数据已存在, 直接开始机器学习实验\n",
                        "acc=0.7751, precision=0.7769, recall=0.7742, f1=0.7743\n",
                        "----------------------------------------------------------------------------------------------------------\n",
                        "K = 45\n",
                        "匿名化数据已存在, 直接开始机器学习实验\n",
                        "acc=0.7751, precision=0.7769, recall=0.7742, f1=0.7743\n",
                        "----------------------------------------------------------------------------------------------------------\n",
                        "K = 50\n",
                        "匿名化数据已存在, 直接开始机器学习实验\n",
                        "acc=0.7751, precision=0.7769, recall=0.7742, f1=0.7743\n",
                        "----------------------------------------------------------------------------------------------------------\n",
                        "K = 55\n",
                        "匿名化数据已存在, 直接开始机器学习实验\n",
                        "acc=0.7751, precision=0.7769, recall=0.7742, f1=0.7743\n",
                        "----------------------------------------------------------------------------------------------------------\n",
                        "K = 60\n",
                        "匿名化数据已存在, 直接开始机器学习实验\n",
                        "acc=0.7108, precision=0.7113, recall=0.7112, f1=0.7108\n",
                        "----------------------------------------------------------------------------------------------------------\n",
                        "K = 65\n",
                        "匿名化数据已存在, 直接开始机器学习实验\n",
                        "acc=0.7068, precision=0.7226, recall=0.7094, f1=0.7031\n",
                        "----------------------------------------------------------------------------------------------------------\n",
                        "K = 70\n",
                        "匿名化数据已存在, 直接开始机器学习实验\n",
                        "acc=0.7068, precision=0.7226, recall=0.7094, f1=0.7031\n",
                        "----------------------------------------------------------------------------------------------------------\n",
                        "K = 75\n",
                        "匿名化数据已存在, 直接开始机器学习实验\n",
                        "acc=0.7068, precision=0.7226, recall=0.7094, f1=0.7031\n",
                        "----------------------------------------------------------------------------------------------------------\n",
                        "K = 80\n",
                        "匿名化数据已存在, 直接开始机器学习实验\n",
                        "acc=0.7068, precision=0.7226, recall=0.7094, f1=0.7031\n",
                        "----------------------------------------------------------------------------------------------------------\n",
                        "K = 85\n",
                        "匿名化数据已存在, 直接开始机器学习实验\n",
                        "acc=0.7068, precision=0.7226, recall=0.7094, f1=0.7031\n",
                        "----------------------------------------------------------------------------------------------------------\n",
                        "K = 90\n",
                        "匿名化数据已存在, 直接开始机器学习实验\n",
                        "acc=0.7068, precision=0.7226, recall=0.7094, f1=0.7031\n",
                        "----------------------------------------------------------------------------------------------------------\n",
                        "K = 95\n",
                        "匿名化数据已存在, 直接开始机器学习实验\n",
                        "acc=0.7068, precision=0.7226, recall=0.7094, f1=0.7031\n",
                        "----------------------------------------------------------------------------------------------------------\n",
                        "K = 100\n",
                        "匿名化数据已存在, 直接开始机器学习实验\n",
                        "acc=0.7068, precision=0.7226, recall=0.7094, f1=0.7031\n",
                        "----------------------------------------------------------------------------------------------------------\n",
                        "CPU times: user 3.45 s, sys: 31.5 ms, total: 3.48 s\n",
                        "Wall time: 3.49 s\n"
                    ]
                }
            ],
            "source": [
                "%%time\n",
                "%run main.py --dataset mgm --anonymity_method mondrian --model svm --experiment Y "
            ]
        },
        {
            "cell_type": "code",
            "execution_count": 5,
            "metadata": {},
            "outputs": [
                {
                    "name": "stdout",
                    "output_type": "stream",
                    "text": [
                        "----------------------------------------------------------------------------------------------------------\n",
                        "Namespace(anonymity=50, anonymity_method='mondrian', dataset='mgm', experiment='Y', model='gbt')\n",
                        "----------------------------------------------------------------------------------------------------------\n",
                        "GradientBoostingClassifier(learning_rate=1.0, max_depth=1, random_state=0)\n",
                        "baseline: acc=0.8514, precision=0.8570, recall=0.8501, f1=0.8504\n",
                        "----------------------------------------------------------------------------------------------------------\n",
                        "K = 2\n",
                        "匿名化数据已存在, 直接开始机器学习实验\n",
                        "acc=0.8554, precision=0.8591, recall=0.8544, f1=0.8547\n",
                        "----------------------------------------------------------------------------------------------------------\n",
                        "K = 5\n",
                        "匿名化数据已存在, 直接开始机器学习实验\n",
                        "acc=0.8313, precision=0.8337, recall=0.8305, f1=0.8307\n",
                        "----------------------------------------------------------------------------------------------------------\n",
                        "K = 10\n",
                        "匿名化数据已存在, 直接开始机器学习实验\n",
                        "acc=0.8072, precision=0.8086, recall=0.8065, f1=0.8067\n",
                        "----------------------------------------------------------------------------------------------------------\n",
                        "K = 15\n",
                        "匿名化数据已存在, 直接开始机器学习实验\n",
                        "acc=0.7952, precision=0.7976, recall=0.7942, f1=0.7943\n",
                        "----------------------------------------------------------------------------------------------------------\n",
                        "K = 20\n",
                        "匿名化数据已存在, 直接开始机器学习实验\n",
                        "acc=0.8032, precision=0.8042, recall=0.8026, f1=0.8028\n",
                        "----------------------------------------------------------------------------------------------------------\n",
                        "K = 25\n",
                        "匿名化数据已存在, 直接开始机器学习实验\n",
                        "acc=0.7751, precision=0.7769, recall=0.7742, f1=0.7743\n",
                        "----------------------------------------------------------------------------------------------------------\n",
                        "K = 30\n",
                        "匿名化数据已存在, 直接开始机器学习实验\n",
                        "acc=0.7751, precision=0.7769, recall=0.7742, f1=0.7743\n",
                        "----------------------------------------------------------------------------------------------------------\n",
                        "K = 35\n",
                        "匿名化数据已存在, 直接开始机器学习实验\n",
                        "acc=0.7751, precision=0.7769, recall=0.7742, f1=0.7743\n",
                        "----------------------------------------------------------------------------------------------------------\n",
                        "K = 40\n",
                        "匿名化数据已存在, 直接开始机器学习实验\n",
                        "acc=0.7751, precision=0.7769, recall=0.7742, f1=0.7743\n",
                        "----------------------------------------------------------------------------------------------------------\n",
                        "K = 45\n",
                        "匿名化数据已存在, 直接开始机器学习实验\n",
                        "acc=0.7751, precision=0.7769, recall=0.7742, f1=0.7743\n",
                        "----------------------------------------------------------------------------------------------------------\n",
                        "K = 50\n",
                        "匿名化数据已存在, 直接开始机器学习实验\n",
                        "acc=0.7751, precision=0.7769, recall=0.7742, f1=0.7743\n",
                        "----------------------------------------------------------------------------------------------------------\n",
                        "K = 55\n",
                        "匿名化数据已存在, 直接开始机器学习实验\n",
                        "acc=0.7751, precision=0.7769, recall=0.7742, f1=0.7743\n",
                        "----------------------------------------------------------------------------------------------------------\n",
                        "K = 60\n",
                        "匿名化数据已存在, 直接开始机器学习实验\n",
                        "acc=0.6867, precision=0.6993, recall=0.6840, f1=0.6797\n",
                        "----------------------------------------------------------------------------------------------------------\n",
                        "K = 65\n",
                        "匿名化数据已存在, 直接开始机器学习实验\n",
                        "acc=0.7068, precision=0.7226, recall=0.7094, f1=0.7031\n",
                        "----------------------------------------------------------------------------------------------------------\n",
                        "K = 70\n",
                        "匿名化数据已存在, 直接开始机器学习实验\n",
                        "acc=0.7068, precision=0.7226, recall=0.7094, f1=0.7031\n",
                        "----------------------------------------------------------------------------------------------------------\n",
                        "K = 75\n",
                        "匿名化数据已存在, 直接开始机器学习实验\n",
                        "acc=0.7068, precision=0.7226, recall=0.7094, f1=0.7031\n",
                        "----------------------------------------------------------------------------------------------------------\n",
                        "K = 80\n",
                        "匿名化数据已存在, 直接开始机器学习实验\n",
                        "acc=0.7068, precision=0.7226, recall=0.7094, f1=0.7031\n",
                        "----------------------------------------------------------------------------------------------------------\n",
                        "K = 85\n",
                        "匿名化数据已存在, 直接开始机器学习实验\n",
                        "acc=0.7068, precision=0.7226, recall=0.7094, f1=0.7031\n",
                        "----------------------------------------------------------------------------------------------------------\n",
                        "K = 90\n",
                        "匿名化数据已存在, 直接开始机器学习实验\n",
                        "acc=0.7068, precision=0.7226, recall=0.7094, f1=0.7031\n",
                        "----------------------------------------------------------------------------------------------------------\n",
                        "K = 95\n",
                        "匿名化数据已存在, 直接开始机器学习实验\n",
                        "acc=0.7068, precision=0.7226, recall=0.7094, f1=0.7031\n",
                        "----------------------------------------------------------------------------------------------------------\n",
                        "K = 100\n",
                        "匿名化数据已存在, 直接开始机器学习实验\n",
                        "acc=0.7068, precision=0.7226, recall=0.7094, f1=0.7031\n",
                        "----------------------------------------------------------------------------------------------------------\n",
                        "CPU times: user 6.88 s, sys: 48.3 ms, total: 6.92 s\n",
                        "Wall time: 6.91 s\n"
                    ]
                }
            ],
            "source": [
                "%%time\n",
                "%run main.py --dataset mgm --anonymity_method mondrian --model gbt --experiment Y "
            ]
        },
        {
            "cell_type": "markdown",
            "metadata": {},
            "source": [
                "## TDG"
            ]
        },
        {
            "cell_type": "code",
            "execution_count": 6,
            "metadata": {},
            "outputs": [
                {
                    "name": "stdout",
                    "output_type": "stream",
                    "text": [
                        "----------------------------------------------------------------------------------------------------------\n",
                        "Namespace(anonymity=50, anonymity_method='tdg', dataset='mgm', experiment='Y', model='lr')\n",
                        "----------------------------------------------------------------------------------------------------------\n",
                        "LogisticRegression(max_iter=1000)\n",
                        "baseline: acc=0.8715, precision=0.8725, recall=0.8710, f1=0.8712\n",
                        "----------------------------------------------------------------------------------------------------------\n",
                        "K = 2\n",
                        "匿名化数据已存在, 直接开始机器学习实验\n"
                    ]
                },
                {
                    "name": "stdout",
                    "output_type": "stream",
                    "text": [
                        "acc=0.8474, precision=0.8475, recall=0.8472, f1=0.8473\n",
                        "----------------------------------------------------------------------------------------------------------\n",
                        "K = 5\n",
                        "匿名化数据已存在, 直接开始机器学习实验\n",
                        "acc=0.8313, precision=0.8313, recall=0.8314, f1=0.8313\n",
                        "----------------------------------------------------------------------------------------------------------\n",
                        "K = 10\n",
                        "匿名化数据已存在, 直接开始机器学习实验\n",
                        "acc=0.8032, precision=0.8032, recall=0.8031, f1=0.8031\n",
                        "----------------------------------------------------------------------------------------------------------\n",
                        "K = 15\n",
                        "匿名化数据已存在, 直接开始机器学习实验\n",
                        "acc=0.7912, precision=0.7946, recall=0.7922, f1=0.7909\n",
                        "----------------------------------------------------------------------------------------------------------\n",
                        "K = 20\n",
                        "匿名化数据已存在, 直接开始机器学习实验\n",
                        "acc=0.8273, precision=0.8295, recall=0.8281, f1=0.8272\n",
                        "----------------------------------------------------------------------------------------------------------\n",
                        "K = 25\n",
                        "匿名化数据已存在, 直接开始机器学习实验\n",
                        "acc=0.8193, precision=0.8196, recall=0.8196, f1=0.8193\n",
                        "----------------------------------------------------------------------------------------------------------\n",
                        "K = 30\n",
                        "匿名化数据已存在, 直接开始机器学习实验\n",
                        "acc=0.8153, precision=0.8184, recall=0.8142, f1=0.8144\n",
                        "----------------------------------------------------------------------------------------------------------\n",
                        "K = 35\n",
                        "匿名化数据已存在, 直接开始机器学习实验\n",
                        "acc=0.7590, precision=0.7592, recall=0.7593, f1=0.7590\n",
                        "----------------------------------------------------------------------------------------------------------\n",
                        "K = 40\n",
                        "匿名化数据已存在, 直接开始机器学习实验\n",
                        "acc=0.7550, precision=0.7745, recall=0.7523, f1=0.7492\n",
                        "----------------------------------------------------------------------------------------------------------\n",
                        "K = 45\n",
                        "匿名化数据已存在, 直接开始机器学习实验\n",
                        "acc=0.7390, precision=0.7506, recall=0.7367, f1=0.7346\n",
                        "----------------------------------------------------------------------------------------------------------\n",
                        "K = 50\n",
                        "匿名化数据已存在, 直接开始机器学习实验\n",
                        "acc=0.7671, precision=0.7728, recall=0.7655, f1=0.7651\n",
                        "----------------------------------------------------------------------------------------------------------\n",
                        "K = 55\n",
                        "匿名化数据已存在, 直接开始机器学习实验\n",
                        "acc=0.7229, precision=0.7271, recall=0.7242, f1=0.7222\n",
                        "----------------------------------------------------------------------------------------------------------\n",
                        "K = 60\n",
                        "匿名化数据已存在, 直接开始机器学习实验\n",
                        "acc=0.7108, precision=0.7133, recall=0.7096, f1=0.7091\n",
                        "----------------------------------------------------------------------------------------------------------\n",
                        "K = 65\n",
                        "匿名化数据已存在, 直接开始机器学习实验\n",
                        "acc=0.7108, precision=0.7133, recall=0.7096, f1=0.7091\n",
                        "----------------------------------------------------------------------------------------------------------\n",
                        "K = 70\n",
                        "匿名化数据已存在, 直接开始机器学习实验\n",
                        "acc=0.7751, precision=0.7841, recall=0.7732, f1=0.7724\n",
                        "----------------------------------------------------------------------------------------------------------\n",
                        "K = 75\n",
                        "匿名化数据已存在, 直接开始机器学习实验\n",
                        "acc=0.6988, precision=0.6999, recall=0.6994, f1=0.6987\n",
                        "----------------------------------------------------------------------------------------------------------\n",
                        "K = 80\n",
                        "匿名化数据已存在, 直接开始机器学习实验\n",
                        "acc=0.8193, precision=0.8196, recall=0.8196, f1=0.8193\n",
                        "----------------------------------------------------------------------------------------------------------\n",
                        "K = 85\n",
                        "匿名化数据已存在, 直接开始机器学习实验\n",
                        "acc=0.6064, precision=0.6062, recall=0.6061, f1=0.6061\n",
                        "----------------------------------------------------------------------------------------------------------\n",
                        "K = 90\n",
                        "匿名化数据已存在, 直接开始机器学习实验\n",
                        "acc=0.7349, precision=0.7410, recall=0.7332, f1=0.7322\n",
                        "----------------------------------------------------------------------------------------------------------\n",
                        "K = 95\n",
                        "匿名化数据已存在, 直接开始机器学习实验\n",
                        "acc=0.7671, precision=0.7838, recall=0.7646, f1=0.7624\n",
                        "----------------------------------------------------------------------------------------------------------\n",
                        "K = 100\n",
                        "匿名化数据已存在, 直接开始机器学习实验\n",
                        "acc=0.7149, precision=0.7334, recall=0.7176, f1=0.7107\n",
                        "----------------------------------------------------------------------------------------------------------\n",
                        "CPU times: user 6.21 s, sys: 2.88 s, total: 9.09 s\n",
                        "Wall time: 3.76 s\n"
                    ]
                }
            ],
            "source": [
                "%%time\n",
                "%run main.py --dataset mgm --anonymity_method tdg --model lr --experiment Y "
            ]
        },
        {
            "cell_type": "code",
            "execution_count": 7,
            "metadata": {},
            "outputs": [
                {
                    "name": "stdout",
                    "output_type": "stream",
                    "text": [
                        "----------------------------------------------------------------------------------------------------------\n",
                        "Namespace(anonymity=50, anonymity_method='tdg', dataset='mgm', experiment='Y', model='nb')\n",
                        "----------------------------------------------------------------------------------------------------------\n",
                        "GaussianNB(var_smoothing=1.0)\n",
                        "baseline: acc=0.8635, precision=0.8673, recall=0.8624, f1=0.8628\n",
                        "----------------------------------------------------------------------------------------------------------\n",
                        "K = 2\n",
                        "匿名化数据已存在, 直接开始机器学习实验\n",
                        "acc=0.8434, precision=0.8442, recall=0.8439, f1=0.8434\n",
                        "----------------------------------------------------------------------------------------------------------\n",
                        "K = 5\n",
                        "匿名化数据已存在, 直接开始机器学习实验\n",
                        "acc=0.8353, precision=0.8398, recall=0.8365, f1=0.8351\n",
                        "----------------------------------------------------------------------------------------------------------\n",
                        "K = 10\n",
                        "匿名化数据已存在, 直接开始机器学习实验\n",
                        "acc=0.7952, precision=0.7973, recall=0.7960, f1=0.7951\n",
                        "----------------------------------------------------------------------------------------------------------\n",
                        "K = 15\n",
                        "匿名化数据已存在, 直接开始机器学习实验\n",
                        "acc=0.8233, precision=0.8312, recall=0.8248, f1=0.8226\n",
                        "----------------------------------------------------------------------------------------------------------\n",
                        "K = 20\n",
                        "匿名化数据已存在, 直接开始机器学习实验\n",
                        "acc=0.7912, precision=0.8138, recall=0.7938, f1=0.7883\n",
                        "----------------------------------------------------------------------------------------------------------\n",
                        "K = 25\n",
                        "匿名化数据已存在, 直接开始机器学习实验\n",
                        "acc=0.7952, precision=0.8051, recall=0.7970, f1=0.7941\n",
                        "----------------------------------------------------------------------------------------------------------\n",
                        "K = 30\n",
                        "匿名化数据已存在, 直接开始机器学习实验\n",
                        "acc=0.8153, precision=0.8184, recall=0.8142, f1=0.8144\n",
                        "----------------------------------------------------------------------------------------------------------\n",
                        "K = 35\n",
                        "匿名化数据已存在, 直接开始机器学习实验\n",
                        "acc=0.7590, precision=0.7592, recall=0.7593, f1=0.7590\n",
                        "----------------------------------------------------------------------------------------------------------\n",
                        "K = 40\n",
                        "匿名化数据已存在, 直接开始机器学习实验\n",
                        "acc=0.6948, precision=0.7591, recall=0.6897, f1=0.6710\n",
                        "----------------------------------------------------------------------------------------------------------\n",
                        "K = 45\n",
                        "匿名化数据已存在, 直接开始机器学习实验\n",
                        "acc=0.7390, precision=0.7458, recall=0.7372, f1=0.7361\n",
                        "----------------------------------------------------------------------------------------------------------\n",
                        "K = 50\n",
                        "匿名化数据已存在, 直接开始机器学习实验\n",
                        "acc=0.7229, precision=0.7262, recall=0.7240, f1=0.7224\n",
                        "----------------------------------------------------------------------------------------------------------\n",
                        "K = 55\n",
                        "匿名化数据已存在, 直接开始机器学习实验\n",
                        "acc=0.7028, precision=0.7051, recall=0.7016, f1=0.7011\n",
                        "----------------------------------------------------------------------------------------------------------\n",
                        "K = 60\n",
                        "匿名化数据已存在, 直接开始机器学习实验\n",
                        "acc=0.7430, precision=0.7859, recall=0.7390, f1=0.7308\n",
                        "----------------------------------------------------------------------------------------------------------\n",
                        "K = 65\n",
                        "匿名化数据已存在, 直接开始机器学习实验\n",
                        "acc=0.6827, precision=0.7018, recall=0.6795, f1=0.6725\n",
                        "----------------------------------------------------------------------------------------------------------\n",
                        "K = 70\n",
                        "匿名化数据已存在, 直接开始机器学习实验\n",
                        "acc=0.7550, precision=0.7549, recall=0.7550, f1=0.7550\n",
                        "----------------------------------------------------------------------------------------------------------\n",
                        "K = 75\n",
                        "匿名化数据已存在, 直接开始机器学习实验\n",
                        "acc=0.5743, precision=0.5781, recall=0.5714, f1=0.5636\n",
                        "----------------------------------------------------------------------------------------------------------\n",
                        "K = 80\n",
                        "匿名化数据已存在, 直接开始机器学习实验\n",
                        "acc=0.8193, precision=0.8196, recall=0.8196, f1=0.8193\n",
                        "----------------------------------------------------------------------------------------------------------\n",
                        "K = 85\n",
                        "匿名化数据已存在, 直接开始机器学习实验\n",
                        "acc=0.6064, precision=0.6062, recall=0.6061, f1=0.6061\n",
                        "----------------------------------------------------------------------------------------------------------\n",
                        "K = 90\n",
                        "匿名化数据已存在, 直接开始机器学习实验\n",
                        "acc=0.6787, precision=0.7061, recall=0.6749, f1=0.6646\n",
                        "----------------------------------------------------------------------------------------------------------\n",
                        "K = 95\n",
                        "匿名化数据已存在, 直接开始机器学习实验\n",
                        "acc=0.7671, precision=0.7838, recall=0.7646, f1=0.7624\n",
                        "----------------------------------------------------------------------------------------------------------\n",
                        "K = 100\n",
                        "匿名化数据已存在, 直接开始机器学习实验\n",
                        "acc=0.6747, precision=0.6888, recall=0.6717, f1=0.6661\n",
                        "----------------------------------------------------------------------------------------------------------\n",
                        "CPU times: user 3.56 s, sys: 19 ms, total: 3.58 s\n",
                        "Wall time: 3.56 s\n"
                    ]
                }
            ],
            "source": [
                "%%time\n",
                "%run main.py --dataset mgm --anonymity_method tdg --model nb --experiment Y "
            ]
        },
        {
            "cell_type": "code",
            "execution_count": 8,
            "metadata": {},
            "outputs": [
                {
                    "name": "stdout",
                    "output_type": "stream",
                    "text": [
                        "----------------------------------------------------------------------------------------------------------\n",
                        "Namespace(anonymity=50, anonymity_method='tdg', dataset='mgm', experiment='Y', model='knn')\n",
                        "----------------------------------------------------------------------------------------------------------\n",
                        "KNeighborsClassifier(n_neighbors=10)\n",
                        "baseline: acc=0.8594, precision=0.8626, recall=0.8585, f1=0.8589\n",
                        "----------------------------------------------------------------------------------------------------------\n",
                        "K = 2\n",
                        "匿名化数据已存在, 直接开始机器学习实验\n"
                    ]
                },
                {
                    "name": "stdout",
                    "output_type": "stream",
                    "text": [
                        "acc=0.8112, precision=0.8161, recall=0.8100, f1=0.8100\n",
                        "----------------------------------------------------------------------------------------------------------\n",
                        "K = 5\n",
                        "匿名化数据已存在, 直接开始机器学习实验\n",
                        "acc=0.7992, precision=0.8044, recall=0.7978, f1=0.7978\n",
                        "----------------------------------------------------------------------------------------------------------\n",
                        "K = 10\n",
                        "匿名化数据已存在, 直接开始机器学习实验\n",
                        "acc=0.7791, precision=0.7806, recall=0.7783, f1=0.7784\n",
                        "----------------------------------------------------------------------------------------------------------\n",
                        "K = 15\n",
                        "匿名化数据已存在, 直接开始机器学习实验\n",
                        "acc=0.8193, precision=0.8220, recall=0.8183, f1=0.8185\n",
                        "----------------------------------------------------------------------------------------------------------\n",
                        "K = 20\n",
                        "匿名化数据已存在, 直接开始机器学习实验\n",
                        "acc=0.8193, precision=0.8192, recall=0.8193, f1=0.8192\n",
                        "----------------------------------------------------------------------------------------------------------\n",
                        "K = 25\n",
                        "匿名化数据已存在, 直接开始机器学习实验\n",
                        "acc=0.8233, precision=0.8266, recall=0.8223, f1=0.8225\n",
                        "----------------------------------------------------------------------------------------------------------\n",
                        "K = 30\n",
                        "匿名化数据已存在, 直接开始机器学习实验\n",
                        "acc=0.8273, precision=0.8292, recall=0.8265, f1=0.8268\n",
                        "----------------------------------------------------------------------------------------------------------\n",
                        "K = 35\n",
                        "匿名化数据已存在, 直接开始机器学习实验\n",
                        "acc=0.7631, precision=0.7742, recall=0.7609, f1=0.7596\n",
                        "----------------------------------------------------------------------------------------------------------\n",
                        "K = 40\n",
                        "匿名化数据已存在, 直接开始机器学习实验\n",
                        "acc=0.7871, precision=0.7871, recall=0.7870, f1=0.7870\n",
                        "----------------------------------------------------------------------------------------------------------\n",
                        "K = 45\n",
                        "匿名化数据已存在, 直接开始机器学习实验\n",
                        "acc=0.8032, precision=0.8035, recall=0.8035, f1=0.8032\n",
                        "----------------------------------------------------------------------------------------------------------\n",
                        "K = 50\n",
                        "匿名化数据已存在, 直接开始机器学习实验\n",
                        "acc=0.7992, precision=0.7995, recall=0.7988, f1=0.7989\n",
                        "----------------------------------------------------------------------------------------------------------\n",
                        "K = 55\n",
                        "匿名化数据已存在, 直接开始机器学习实验\n",
                        "acc=0.7068, precision=0.7157, recall=0.7087, f1=0.7049\n",
                        "----------------------------------------------------------------------------------------------------------\n",
                        "K = 60\n",
                        "匿名化数据已存在, 直接开始机器学习实验\n",
                        "acc=0.8313, precision=0.8337, recall=0.8305, f1=0.8307\n",
                        "----------------------------------------------------------------------------------------------------------\n",
                        "K = 65\n",
                        "匿名化数据已存在, 直接开始机器学习实验\n",
                        "acc=0.5823, precision=0.5881, recall=0.5844, f1=0.5787\n",
                        "----------------------------------------------------------------------------------------------------------\n",
                        "K = 70\n",
                        "匿名化数据已存在, 直接开始机器学习实验\n",
                        "acc=0.7751, precision=0.7841, recall=0.7732, f1=0.7724\n",
                        "----------------------------------------------------------------------------------------------------------\n",
                        "K = 75\n",
                        "匿名化数据已存在, 直接开始机器学习实验\n",
                        "acc=0.8193, precision=0.8196, recall=0.8196, f1=0.8193\n",
                        "----------------------------------------------------------------------------------------------------------\n",
                        "K = 80\n",
                        "匿名化数据已存在, 直接开始机器学习实验\n",
                        "acc=0.8193, precision=0.8196, recall=0.8196, f1=0.8193\n",
                        "----------------------------------------------------------------------------------------------------------\n",
                        "K = 85\n",
                        "匿名化数据已存在, 直接开始机器学习实验\n",
                        "acc=0.6064, precision=0.6062, recall=0.6061, f1=0.6061\n",
                        "----------------------------------------------------------------------------------------------------------\n",
                        "K = 90\n",
                        "匿名化数据已存在, 直接开始机器学习实验\n",
                        "acc=0.7349, precision=0.7410, recall=0.7332, f1=0.7322\n",
                        "----------------------------------------------------------------------------------------------------------\n",
                        "K = 95\n",
                        "匿名化数据已存在, 直接开始机器学习实验\n",
                        "acc=0.7671, precision=0.7838, recall=0.7646, f1=0.7624\n",
                        "----------------------------------------------------------------------------------------------------------\n",
                        "K = 100\n",
                        "匿名化数据已存在, 直接开始机器学习实验\n",
                        "acc=0.7149, precision=0.7334, recall=0.7176, f1=0.7107\n",
                        "----------------------------------------------------------------------------------------------------------\n",
                        "CPU times: user 4.61 s, sys: 31.9 ms, total: 4.64 s\n",
                        "Wall time: 3.93 s\n"
                    ]
                }
            ],
            "source": [
                "%%time\n",
                "%run main.py --dataset mgm --anonymity_method tdg --model knn --experiment Y "
            ]
        },
        {
            "cell_type": "code",
            "execution_count": 9,
            "metadata": {},
            "outputs": [
                {
                    "name": "stdout",
                    "output_type": "stream",
                    "text": [
                        "----------------------------------------------------------------------------------------------------------\n",
                        "Namespace(anonymity=50, anonymity_method='tdg', dataset='mgm', experiment='Y', model='svm')\n",
                        "----------------------------------------------------------------------------------------------------------\n",
                        "LinearSVC(dual=False)\n",
                        "baseline: acc=0.8635, precision=0.8661, recall=0.8626, f1=0.8630\n",
                        "----------------------------------------------------------------------------------------------------------\n",
                        "K = 2\n",
                        "匿名化数据已存在, 直接开始机器学习实验\n",
                        "acc=0.8675, precision=0.8689, recall=0.8669, f1=0.8672\n",
                        "----------------------------------------------------------------------------------------------------------\n",
                        "K = 5\n",
                        "匿名化数据已存在, 直接开始机器学习实验\n",
                        "acc=0.8474, precision=0.8475, recall=0.8472, f1=0.8473\n",
                        "----------------------------------------------------------------------------------------------------------\n",
                        "K = 10\n",
                        "匿名化数据已存在, 直接开始机器学习实验\n",
                        "acc=0.8072, precision=0.8086, recall=0.8065, f1=0.8067\n",
                        "----------------------------------------------------------------------------------------------------------\n",
                        "K = 15\n",
                        "匿名化数据已存在, 直接开始机器学习实验\n",
                        "acc=0.7912, precision=0.7946, recall=0.7922, f1=0.7909\n",
                        "----------------------------------------------------------------------------------------------------------\n",
                        "K = 20\n",
                        "匿名化数据已存在, 直接开始机器学习实验\n",
                        "acc=0.8273, precision=0.8345, recall=0.8288, f1=0.8268\n",
                        "----------------------------------------------------------------------------------------------------------\n",
                        "K = 25\n",
                        "匿名化数据已存在, 直接开始机器学习实验\n",
                        "acc=0.8193, precision=0.8196, recall=0.8196, f1=0.8193\n",
                        "----------------------------------------------------------------------------------------------------------\n",
                        "K = 30\n",
                        "匿名化数据已存在, 直接开始机器学习实验\n",
                        "acc=0.8153, precision=0.8184, recall=0.8142, f1=0.8144\n",
                        "----------------------------------------------------------------------------------------------------------\n",
                        "K = 35\n",
                        "匿名化数据已存在, 直接开始机器学习实验\n",
                        "acc=0.7590, precision=0.7592, recall=0.7593, f1=0.7590\n",
                        "----------------------------------------------------------------------------------------------------------\n",
                        "K = 40\n",
                        "匿名化数据已存在, 直接开始机器学习实验\n",
                        "acc=0.7550, precision=0.7745, recall=0.7523, f1=0.7492\n",
                        "----------------------------------------------------------------------------------------------------------\n",
                        "K = 45\n",
                        "匿名化数据已存在, 直接开始机器学习实验\n",
                        "acc=0.7390, precision=0.7506, recall=0.7367, f1=0.7346\n",
                        "----------------------------------------------------------------------------------------------------------\n",
                        "K = 50\n",
                        "匿名化数据已存在, 直接开始机器学习实验\n",
                        "acc=0.7671, precision=0.7728, recall=0.7655, f1=0.7651\n",
                        "----------------------------------------------------------------------------------------------------------\n",
                        "K = 55\n",
                        "匿名化数据已存在, 直接开始机器学习实验\n",
                        "acc=0.7229, precision=0.7271, recall=0.7242, f1=0.7222\n",
                        "----------------------------------------------------------------------------------------------------------\n",
                        "K = 60\n",
                        "匿名化数据已存在, 直接开始机器学习实验\n",
                        "acc=0.7108, precision=0.7133, recall=0.7096, f1=0.7091\n",
                        "----------------------------------------------------------------------------------------------------------\n",
                        "K = 65\n",
                        "匿名化数据已存在, 直接开始机器学习实验\n",
                        "acc=0.7108, precision=0.7133, recall=0.7096, f1=0.7091\n",
                        "----------------------------------------------------------------------------------------------------------\n",
                        "K = 70\n",
                        "匿名化数据已存在, 直接开始机器学习实验\n",
                        "acc=0.7751, precision=0.7841, recall=0.7732, f1=0.7724\n",
                        "----------------------------------------------------------------------------------------------------------\n",
                        "K = 75\n",
                        "匿名化数据已存在, 直接开始机器学习实验\n",
                        "acc=0.6988, precision=0.6999, recall=0.6994, f1=0.6987\n",
                        "----------------------------------------------------------------------------------------------------------\n",
                        "K = 80\n",
                        "匿名化数据已存在, 直接开始机器学习实验\n",
                        "acc=0.8193, precision=0.8196, recall=0.8196, f1=0.8193\n",
                        "----------------------------------------------------------------------------------------------------------\n",
                        "K = 85\n",
                        "匿名化数据已存在, 直接开始机器学习实验\n",
                        "acc=0.6064, precision=0.6062, recall=0.6061, f1=0.6061\n",
                        "----------------------------------------------------------------------------------------------------------\n",
                        "K = 90\n",
                        "匿名化数据已存在, 直接开始机器学习实验\n",
                        "acc=0.7349, precision=0.7410, recall=0.7332, f1=0.7322\n",
                        "----------------------------------------------------------------------------------------------------------\n",
                        "K = 95\n",
                        "匿名化数据已存在, 直接开始机器学习实验\n",
                        "acc=0.7671, precision=0.7838, recall=0.7646, f1=0.7624\n",
                        "----------------------------------------------------------------------------------------------------------\n",
                        "K = 100\n",
                        "匿名化数据已存在, 直接开始机器学习实验\n",
                        "acc=0.7149, precision=0.7334, recall=0.7176, f1=0.7107\n",
                        "----------------------------------------------------------------------------------------------------------\n",
                        "CPU times: user 3.49 s, sys: 35.6 ms, total: 3.53 s\n",
                        "Wall time: 3.52 s\n"
                    ]
                }
            ],
            "source": [
                "%%time\n",
                "%run main.py --dataset mgm --anonymity_method tdg --model svm --experiment Y "
            ]
        },
        {
            "cell_type": "code",
            "execution_count": 10,
            "metadata": {},
            "outputs": [
                {
                    "name": "stdout",
                    "output_type": "stream",
                    "text": [
                        "----------------------------------------------------------------------------------------------------------\n",
                        "Namespace(anonymity=50, anonymity_method='tdg', dataset='mgm', experiment='Y', model='gbt')\n",
                        "----------------------------------------------------------------------------------------------------------\n"
                    ]
                },
                {
                    "name": "stdout",
                    "output_type": "stream",
                    "text": [
                        "GradientBoostingClassifier(learning_rate=1.0, max_depth=1, random_state=0)\n",
                        "baseline: acc=0.8514, precision=0.8570, recall=0.8501, f1=0.8504\n",
                        "----------------------------------------------------------------------------------------------------------\n",
                        "K = 2\n",
                        "匿名化数据已存在, 直接开始机器学习实验\n",
                        "acc=0.8594, precision=0.8608, recall=0.8588, f1=0.8591\n",
                        "----------------------------------------------------------------------------------------------------------\n",
                        "K = 5\n",
                        "匿名化数据已存在, 直接开始机器学习实验\n",
                        "acc=0.8474, precision=0.8475, recall=0.8472, f1=0.8473\n",
                        "----------------------------------------------------------------------------------------------------------\n",
                        "K = 10\n",
                        "匿名化数据已存在, 直接开始机器学习实验\n",
                        "acc=0.8032, precision=0.8032, recall=0.8031, f1=0.8031\n",
                        "----------------------------------------------------------------------------------------------------------\n",
                        "K = 15\n",
                        "匿名化数据已存在, 直接开始机器学习实验\n",
                        "acc=0.7912, precision=0.7946, recall=0.7922, f1=0.7909\n",
                        "----------------------------------------------------------------------------------------------------------\n",
                        "K = 20\n",
                        "匿名化数据已存在, 直接开始机器学习实验\n",
                        "acc=0.8193, precision=0.8207, recall=0.8199, f1=0.8192\n",
                        "----------------------------------------------------------------------------------------------------------\n",
                        "K = 25\n",
                        "匿名化数据已存在, 直接开始机器学习实验\n",
                        "acc=0.8072, precision=0.8073, recall=0.8070, f1=0.8071\n",
                        "----------------------------------------------------------------------------------------------------------\n",
                        "K = 30\n",
                        "匿名化数据已存在, 直接开始机器学习实验\n",
                        "acc=0.7871, precision=0.7911, recall=0.7883, f1=0.7868\n",
                        "----------------------------------------------------------------------------------------------------------\n",
                        "K = 35\n",
                        "匿名化数据已存在, 直接开始机器学习实验\n",
                        "acc=0.7229, precision=0.7282, recall=0.7243, f1=0.7220\n",
                        "----------------------------------------------------------------------------------------------------------\n",
                        "K = 40\n",
                        "匿名化数据已存在, 直接开始机器学习实验\n",
                        "acc=0.7871, precision=0.7958, recall=0.7854, f1=0.7848\n",
                        "----------------------------------------------------------------------------------------------------------\n",
                        "K = 45\n",
                        "匿名化数据已存在, 直接开始机器学习实验\n",
                        "acc=0.7711, precision=0.7741, recall=0.7699, f1=0.7699\n",
                        "----------------------------------------------------------------------------------------------------------\n",
                        "K = 50\n",
                        "匿名化数据已存在, 直接开始机器学习实验\n",
                        "acc=0.7671, precision=0.7728, recall=0.7655, f1=0.7651\n",
                        "----------------------------------------------------------------------------------------------------------\n",
                        "K = 55\n",
                        "匿名化数据已存在, 直接开始机器学习实验\n",
                        "acc=0.7590, precision=0.7657, recall=0.7606, f1=0.7582\n",
                        "----------------------------------------------------------------------------------------------------------\n",
                        "K = 60\n",
                        "匿名化数据已存在, 直接开始机器学习实验\n",
                        "acc=0.8474, precision=0.8485, recall=0.8480, f1=0.8474\n",
                        "----------------------------------------------------------------------------------------------------------\n",
                        "K = 65\n",
                        "匿名化数据已存在, 直接开始机器学习实验\n",
                        "acc=0.7108, precision=0.7133, recall=0.7096, f1=0.7091\n",
                        "----------------------------------------------------------------------------------------------------------\n",
                        "K = 70\n",
                        "匿名化数据已存在, 直接开始机器学习实验\n",
                        "acc=0.7751, precision=0.7841, recall=0.7732, f1=0.7724\n",
                        "----------------------------------------------------------------------------------------------------------\n",
                        "K = 75\n",
                        "匿名化数据已存在, 直接开始机器学习实验\n",
                        "acc=0.6988, precision=0.6999, recall=0.6994, f1=0.6987\n",
                        "----------------------------------------------------------------------------------------------------------\n",
                        "K = 80\n",
                        "匿名化数据已存在, 直接开始机器学习实验\n",
                        "acc=0.8193, precision=0.8196, recall=0.8196, f1=0.8193\n",
                        "----------------------------------------------------------------------------------------------------------\n",
                        "K = 85\n",
                        "匿名化数据已存在, 直接开始机器学习实验\n",
                        "acc=0.6064, precision=0.6062, recall=0.6061, f1=0.6061\n",
                        "----------------------------------------------------------------------------------------------------------\n",
                        "K = 90\n",
                        "匿名化数据已存在, 直接开始机器学习实验\n",
                        "acc=0.7349, precision=0.7410, recall=0.7332, f1=0.7322\n",
                        "----------------------------------------------------------------------------------------------------------\n",
                        "K = 95\n",
                        "匿名化数据已存在, 直接开始机器学习实验\n",
                        "acc=0.7671, precision=0.7838, recall=0.7646, f1=0.7624\n",
                        "----------------------------------------------------------------------------------------------------------\n",
                        "K = 100\n",
                        "匿名化数据已存在, 直接开始机器学习实验\n",
                        "acc=0.7149, precision=0.7334, recall=0.7176, f1=0.7107\n",
                        "----------------------------------------------------------------------------------------------------------\n",
                        "CPU times: user 7.23 s, sys: 36 ms, total: 7.27 s\n",
                        "Wall time: 7.25 s\n"
                    ]
                }
            ],
            "source": [
                "%%time\n",
                "%run main.py --dataset mgm --anonymity_method tdg --model gbt --experiment Y "
            ]
        },
        {
            "cell_type": "markdown",
            "metadata": {},
            "source": [
                "## OKA"
            ]
        },
        {
            "cell_type": "code",
            "execution_count": 11,
            "metadata": {},
            "outputs": [
                {
                    "name": "stdout",
                    "output_type": "stream",
                    "text": [
                        "----------------------------------------------------------------------------------------------------------\n",
                        "Namespace(anonymity=50, anonymity_method='oka', dataset='mgm', experiment='Y', model='lr')\n",
                        "----------------------------------------------------------------------------------------------------------\n",
                        "LogisticRegression(max_iter=1000)\n",
                        "baseline: acc=0.8715, precision=0.8725, recall=0.8710, f1=0.8712\n",
                        "----------------------------------------------------------------------------------------------------------\n",
                        "K = 2\n",
                        "匿名化数据已存在, 直接开始机器学习实验\n",
                        "acc=0.8514, precision=0.8516, recall=0.8511, f1=0.8513\n",
                        "----------------------------------------------------------------------------------------------------------\n",
                        "K = 5\n",
                        "匿名化数据已存在, 直接开始机器学习实验\n",
                        "acc=0.7992, precision=0.8017, recall=0.8001, f1=0.7990\n",
                        "----------------------------------------------------------------------------------------------------------\n",
                        "K = 10\n",
                        "匿名化数据已存在, 直接开始机器学习实验\n",
                        "acc=0.8302, precision=0.8298, recall=0.8307, f1=0.8299\n",
                        "----------------------------------------------------------------------------------------------------------\n",
                        "K = 15\n",
                        "匿名化数据已存在, 直接开始机器学习实验\n",
                        "acc=0.7885, precision=0.7850, recall=0.7863, f1=0.7856\n",
                        "----------------------------------------------------------------------------------------------------------\n",
                        "K = 20\n",
                        "匿名化数据已存在, 直接开始机器学习实验\n",
                        "acc=0.8259, precision=0.8359, recall=0.8297, f1=0.8255\n",
                        "----------------------------------------------------------------------------------------------------------\n",
                        "K = 25\n",
                        "匿名化数据已存在, 直接开始机器学习实验\n",
                        "acc=0.7672, precision=0.7666, recall=0.7666, f1=0.7666\n",
                        "----------------------------------------------------------------------------------------------------------\n",
                        "K = 30\n",
                        "匿名化数据已存在, 直接开始机器学习实验\n",
                        "acc=0.7510, precision=0.7519, recall=0.7515, f1=0.7510\n",
                        "----------------------------------------------------------------------------------------------------------\n",
                        "K = 35\n",
                        "匿名化数据已存在, 直接开始机器学习实验\n",
                        "acc=0.7056, precision=0.7032, recall=0.7050, f1=0.7036\n",
                        "----------------------------------------------------------------------------------------------------------\n",
                        "K = 40\n",
                        "匿名化数据已存在, 直接开始机器学习实验\n",
                        "acc=0.7510, precision=0.7519, recall=0.7515, f1=0.7510\n",
                        "----------------------------------------------------------------------------------------------------------\n",
                        "K = 45\n",
                        "匿名化数据已存在, 直接开始机器学习实验\n",
                        "acc=0.7590, precision=0.7614, recall=0.7580, f1=0.7579\n",
                        "----------------------------------------------------------------------------------------------------------\n",
                        "K = 50\n",
                        "匿名化数据已存在, 直接开始机器学习实验\n",
                        "acc=0.7149, precision=0.7439, recall=0.7182, f1=0.7081\n",
                        "----------------------------------------------------------------------------------------------------------\n",
                        "K = 55\n",
                        "匿名化数据已存在, 直接开始机器学习实验\n",
                        "acc=0.7189, precision=0.7190, recall=0.7191, f1=0.7189\n",
                        "----------------------------------------------------------------------------------------------------------\n",
                        "K = 60\n",
                        "匿名化数据已存在, 直接开始机器学习实验\n",
                        "acc=0.7068, precision=0.7068, recall=0.7065, f1=0.7065\n",
                        "----------------------------------------------------------------------------------------------------------\n",
                        "K = 65\n",
                        "匿名化数据已存在, 直接开始机器学习实验\n",
                        "acc=0.7108, precision=0.7173, recall=0.7090, f1=0.7074\n",
                        "----------------------------------------------------------------------------------------------------------\n",
                        "K = 70\n",
                        "匿名化数据已存在, 直接开始机器学习实验\n",
                        "acc=0.7068, precision=0.7073, recall=0.7061, f1=0.7061\n",
                        "----------------------------------------------------------------------------------------------------------\n",
                        "K = 75\n",
                        "匿名化数据已存在, 直接开始机器学习实验\n",
                        "acc=0.8116, precision=0.8118, recall=0.8118, f1=0.8116\n",
                        "----------------------------------------------------------------------------------------------------------\n",
                        "K = 80\n",
                        "匿名化数据已存在, 直接开始机器学习实验\n",
                        "acc=0.6867, precision=0.6971, recall=0.6889, f1=0.6841\n",
                        "----------------------------------------------------------------------------------------------------------\n",
                        "K = 85\n",
                        "匿名化数据已存在, 直接开始机器学习实验\n",
                        "acc=0.6466, precision=0.6545, recall=0.6440, f1=0.6395\n",
                        "----------------------------------------------------------------------------------------------------------\n",
                        "K = 90\n",
                        "匿名化数据已存在, 直接开始机器学习实验\n",
                        "acc=0.8333, precision=0.8443, recall=0.8379, f1=0.8330\n",
                        "----------------------------------------------------------------------------------------------------------\n",
                        "K = 95\n",
                        "匿名化数据已存在, 直接开始机器学习实验\n",
                        "acc=0.6798, precision=0.6859, recall=0.6790, f1=0.6765\n",
                        "----------------------------------------------------------------------------------------------------------\n",
                        "K = 100\n",
                        "匿名化数据已存在, 直接开始机器学习实验\n",
                        "acc=0.6426, precision=0.6440, recall=0.6412, f1=0.6402\n",
                        "----------------------------------------------------------------------------------------------------------\n",
                        "CPU times: user 5.32 s, sys: 1.96 s, total: 7.28 s\n",
                        "Wall time: 3.64 s\n"
                    ]
                }
            ],
            "source": [
                "%%time\n",
                "%run main.py --dataset mgm --anonymity_method oka --model lr --experiment Y "
            ]
        },
        {
            "cell_type": "code",
            "execution_count": 12,
            "metadata": {},
            "outputs": [
                {
                    "name": "stdout",
                    "output_type": "stream",
                    "text": [
                        "----------------------------------------------------------------------------------------------------------\n",
                        "Namespace(anonymity=50, anonymity_method='oka', dataset='mgm', experiment='Y', model='nb')\n",
                        "----------------------------------------------------------------------------------------------------------\n",
                        "GaussianNB(var_smoothing=1.0)\n",
                        "baseline: acc=0.8635, precision=0.8673, recall=0.8624, f1=0.8628\n",
                        "----------------------------------------------------------------------------------------------------------\n",
                        "K = 2\n",
                        "匿名化数据已存在, 直接开始机器学习实验\n",
                        "acc=0.8273, precision=0.8281, recall=0.8278, f1=0.8273\n",
                        "----------------------------------------------------------------------------------------------------------\n",
                        "K = 5\n",
                        "匿名化数据已存在, 直接开始机器学习实验\n",
                        "acc=0.8193, precision=0.8249, recall=0.8206, f1=0.8189\n",
                        "----------------------------------------------------------------------------------------------------------\n",
                        "K = 10\n",
                        "匿名化数据已存在, 直接开始机器学习实验\n",
                        "acc=0.8443, precision=0.8441, recall=0.8452, f1=0.8442\n",
                        "----------------------------------------------------------------------------------------------------------\n",
                        "K = 15\n",
                        "匿名化数据已存在, 直接开始机器学习实验\n",
                        "acc=0.8029, precision=0.8032, recall=0.7943, f1=0.7971\n",
                        "----------------------------------------------------------------------------------------------------------\n",
                        "K = 20\n",
                        "匿名化数据已存在, 直接开始机器学习实验\n",
                        "acc=0.8259, precision=0.8359, recall=0.8297, f1=0.8255\n",
                        "----------------------------------------------------------------------------------------------------------\n",
                        "K = 25\n",
                        "匿名化数据已存在, 直接开始机器学习实验\n",
                        "acc=0.7759, precision=0.7938, recall=0.7820, f1=0.7745\n",
                        "----------------------------------------------------------------------------------------------------------\n",
                        "K = 30\n",
                        "匿名化数据已存在, 直接开始机器学习实验\n",
                        "acc=0.7871, precision=0.7952, recall=0.7888, f1=0.7863\n",
                        "----------------------------------------------------------------------------------------------------------\n",
                        "K = 35\n",
                        "匿名化数据已存在, 直接开始机器学习实验\n",
                        "acc=0.6320, precision=0.6482, recall=0.6443, f1=0.6313\n",
                        "----------------------------------------------------------------------------------------------------------\n",
                        "K = 40\n",
                        "匿名化数据已存在, 直接开始机器学习实验\n",
                        "acc=0.7510, precision=0.7625, recall=0.7488, f1=0.7471\n",
                        "----------------------------------------------------------------------------------------------------------\n",
                        "K = 45\n",
                        "匿名化数据已存在, 直接开始机器学习实验\n",
                        "acc=0.6827, precision=0.6828, recall=0.6828, f1=0.6827\n",
                        "----------------------------------------------------------------------------------------------------------\n",
                        "K = 50\n",
                        "匿名化数据已存在, 直接开始机器学习实验\n",
                        "acc=0.6827, precision=0.6857, recall=0.6812, f1=0.6802\n",
                        "----------------------------------------------------------------------------------------------------------\n",
                        "K = 55\n",
                        "匿名化数据已存在, 直接开始机器学习实验\n",
                        "acc=0.6787, precision=0.7206, recall=0.6829, f1=0.6658\n",
                        "----------------------------------------------------------------------------------------------------------\n",
                        "K = 60\n",
                        "匿名化数据已存在, 直接开始机器学习实验\n",
                        "acc=0.6908, precision=0.6991, recall=0.6927, f1=0.6888\n",
                        "----------------------------------------------------------------------------------------------------------\n",
                        "K = 65\n",
                        "匿名化数据已存在, 直接开始机器学习实验\n",
                        "acc=0.7108, precision=0.7173, recall=0.7090, f1=0.7074\n",
                        "----------------------------------------------------------------------------------------------------------\n",
                        "K = 70\n",
                        "匿名化数据已存在, 直接开始机器学习实验\n",
                        "acc=0.6586, precision=0.6864, recall=0.6545, f1=0.6418\n",
                        "----------------------------------------------------------------------------------------------------------\n",
                        "K = 75\n",
                        "匿名化数据已存在, 直接开始机器学习实验\n",
                        "acc=0.7729, precision=0.7958, recall=0.7749, f1=0.7693\n",
                        "----------------------------------------------------------------------------------------------------------\n",
                        "K = 80\n",
                        "匿名化数据已存在, 直接开始机器学习实验\n",
                        "acc=0.6908, precision=0.6970, recall=0.6888, f1=0.6868\n",
                        "----------------------------------------------------------------------------------------------------------\n",
                        "K = 85\n",
                        "匿名化数据已存在, 直接开始机器学习实验\n",
                        "acc=0.5301, precision=0.5314, recall=0.5311, f1=0.5294\n",
                        "----------------------------------------------------------------------------------------------------------\n",
                        "K = 90\n",
                        "匿名化数据已存在, 直接开始机器学习实验\n",
                        "acc=0.7308, precision=0.7302, recall=0.7294, f1=0.7297\n",
                        "----------------------------------------------------------------------------------------------------------\n",
                        "K = 95\n",
                        "匿名化数据已存在, 直接开始机器学习实验\n",
                        "acc=0.6798, precision=0.6859, recall=0.6790, f1=0.6765\n",
                        "----------------------------------------------------------------------------------------------------------\n",
                        "K = 100\n",
                        "匿名化数据已存在, 直接开始机器学习实验\n",
                        "acc=0.6064, precision=0.7145, recall=0.6134, f1=0.5572\n",
                        "----------------------------------------------------------------------------------------------------------\n",
                        "CPU times: user 3.43 s, sys: 20.5 ms, total: 3.45 s\n",
                        "Wall time: 3.43 s\n"
                    ]
                }
            ],
            "source": [
                "%%time\n",
                "%run main.py --dataset mgm --anonymity_method oka --model nb --experiment Y "
            ]
        },
        {
            "cell_type": "code",
            "execution_count": 13,
            "metadata": {},
            "outputs": [
                {
                    "name": "stdout",
                    "output_type": "stream",
                    "text": [
                        "----------------------------------------------------------------------------------------------------------\n",
                        "Namespace(anonymity=50, anonymity_method='oka', dataset='mgm', experiment='Y', model='knn')\n",
                        "----------------------------------------------------------------------------------------------------------\n"
                    ]
                },
                {
                    "name": "stdout",
                    "output_type": "stream",
                    "text": [
                        "KNeighborsClassifier(n_neighbors=10)\n",
                        "baseline: acc=0.8594, precision=0.8626, recall=0.8585, f1=0.8589\n",
                        "----------------------------------------------------------------------------------------------------------\n",
                        "K = 2\n",
                        "匿名化数据已存在, 直接开始机器学习实验\n",
                        "acc=0.8394, precision=0.8409, recall=0.8386, f1=0.8389\n",
                        "----------------------------------------------------------------------------------------------------------\n",
                        "K = 5\n",
                        "匿名化数据已存在, 直接开始机器学习实验\n",
                        "acc=0.7711, precision=0.7711, recall=0.7712, f1=0.7711\n",
                        "----------------------------------------------------------------------------------------------------------\n",
                        "K = 10\n",
                        "匿名化数据已存在, 直接开始机器学习实验\n",
                        "acc=0.8066, precision=0.8129, recall=0.8105, f1=0.8065\n",
                        "----------------------------------------------------------------------------------------------------------\n",
                        "K = 15\n",
                        "匿名化数据已存在, 直接开始机器学习实验\n",
                        "acc=0.7837, precision=0.7826, recall=0.7869, f1=0.7825\n",
                        "----------------------------------------------------------------------------------------------------------\n",
                        "K = 20\n",
                        "匿名化数据已存在, 直接开始机器学习实验\n",
                        "acc=0.7902, precision=0.7933, recall=0.7924, f1=0.7901\n",
                        "----------------------------------------------------------------------------------------------------------\n",
                        "K = 25\n",
                        "匿名化数据已存在, 直接开始机器学习实验\n",
                        "acc=0.7845, precision=0.7839, recall=0.7839, f1=0.7839\n",
                        "----------------------------------------------------------------------------------------------------------\n",
                        "K = 30\n",
                        "匿名化数据已存在, 直接开始机器学习实验\n",
                        "acc=0.7631, precision=0.7631, recall=0.7632, f1=0.7630\n",
                        "----------------------------------------------------------------------------------------------------------\n",
                        "K = 35\n",
                        "匿名化数据已存在, 直接开始机器学习实验\n",
                        "acc=0.7489, precision=0.7467, recall=0.7488, f1=0.7472\n",
                        "----------------------------------------------------------------------------------------------------------\n",
                        "K = 40\n",
                        "匿名化数据已存在, 直接开始机器学习实验\n",
                        "acc=0.7671, precision=0.7705, recall=0.7658, f1=0.7657\n",
                        "----------------------------------------------------------------------------------------------------------\n",
                        "K = 45\n",
                        "匿名化数据已存在, 直接开始机器学习实验\n",
                        "acc=0.7390, precision=0.7401, recall=0.7396, f1=0.7389\n",
                        "----------------------------------------------------------------------------------------------------------\n",
                        "K = 50\n",
                        "匿名化数据已存在, 直接开始机器学习实验\n",
                        "acc=0.6827, precision=0.6857, recall=0.6812, f1=0.6802\n",
                        "----------------------------------------------------------------------------------------------------------\n",
                        "K = 55\n",
                        "匿名化数据已存在, 直接开始机器学习实验\n",
                        "acc=0.7068, precision=0.7068, recall=0.7065, f1=0.7065\n",
                        "----------------------------------------------------------------------------------------------------------\n",
                        "K = 60\n",
                        "匿名化数据已存在, 直接开始机器学习实验\n",
                        "acc=0.7229, precision=0.7717, recall=0.7271, f1=0.7122\n",
                        "----------------------------------------------------------------------------------------------------------\n",
                        "K = 65\n",
                        "匿名化数据已存在, 直接开始机器学习实验\n",
                        "acc=0.7028, precision=0.7095, recall=0.7045, f1=0.7014\n",
                        "----------------------------------------------------------------------------------------------------------\n",
                        "K = 70\n",
                        "匿名化数据已存在, 直接开始机器学习实验\n",
                        "acc=0.7068, precision=0.7073, recall=0.7061, f1=0.7061\n",
                        "----------------------------------------------------------------------------------------------------------\n",
                        "K = 75\n",
                        "匿名化数据已存在, 直接开始机器学习实验\n",
                        "acc=0.7826, precision=0.7906, recall=0.7814, f1=0.7806\n",
                        "----------------------------------------------------------------------------------------------------------\n",
                        "K = 80\n",
                        "匿名化数据已存在, 直接开始机器学习实验\n",
                        "acc=0.6867, precision=0.6971, recall=0.6889, f1=0.6841\n",
                        "----------------------------------------------------------------------------------------------------------\n",
                        "K = 85\n",
                        "匿名化数据已存在, 直接开始机器学习实验\n",
                        "acc=0.6426, precision=0.6508, recall=0.6399, f1=0.6349\n",
                        "----------------------------------------------------------------------------------------------------------\n",
                        "K = 90\n",
                        "匿名化数据已存在, 直接开始机器学习实验\n",
                        "acc=0.8333, precision=0.8443, recall=0.8379, f1=0.8330\n",
                        "----------------------------------------------------------------------------------------------------------\n",
                        "K = 95\n",
                        "匿名化数据已存在, 直接开始机器学习实验\n",
                        "acc=0.6886, precision=0.7019, recall=0.6897, f1=0.6842\n",
                        "----------------------------------------------------------------------------------------------------------\n",
                        "K = 100\n",
                        "匿名化数据已存在, 直接开始机器学习实验\n",
                        "acc=0.6506, precision=0.6546, recall=0.6520, f1=0.6495\n",
                        "----------------------------------------------------------------------------------------------------------\n",
                        "CPU times: user 4.28 s, sys: 16.1 ms, total: 4.3 s\n",
                        "Wall time: 3.8 s\n"
                    ]
                }
            ],
            "source": [
                "%%time\n",
                "%run main.py --dataset mgm --anonymity_method oka --model knn --experiment Y "
            ]
        },
        {
            "cell_type": "code",
            "execution_count": 14,
            "metadata": {},
            "outputs": [
                {
                    "name": "stdout",
                    "output_type": "stream",
                    "text": [
                        "----------------------------------------------------------------------------------------------------------\n",
                        "Namespace(anonymity=50, anonymity_method='oka', dataset='mgm', experiment='Y', model='svm')\n",
                        "----------------------------------------------------------------------------------------------------------\n",
                        "LinearSVC(dual=False)\n",
                        "baseline: acc=0.8635, precision=0.8661, recall=0.8626, f1=0.8630\n",
                        "----------------------------------------------------------------------------------------------------------\n",
                        "K = 2\n",
                        "匿名化数据已存在, 直接开始机器学习实验\n",
                        "acc=0.8514, precision=0.8516, recall=0.8511, f1=0.8513\n",
                        "----------------------------------------------------------------------------------------------------------\n",
                        "K = 5\n",
                        "匿名化数据已存在, 直接开始机器学习实验\n",
                        "acc=0.8032, precision=0.8062, recall=0.8042, f1=0.8030\n",
                        "----------------------------------------------------------------------------------------------------------\n",
                        "K = 10\n",
                        "匿名化数据已存在, 直接开始机器学习实验\n",
                        "acc=0.8302, precision=0.8296, recall=0.8302, f1=0.8298\n",
                        "----------------------------------------------------------------------------------------------------------\n",
                        "K = 15\n",
                        "匿名化数据已存在, 直接开始机器学习实验\n",
                        "acc=0.7885, precision=0.7850, recall=0.7863, f1=0.7856\n",
                        "----------------------------------------------------------------------------------------------------------\n",
                        "K = 20\n",
                        "匿名化数据已存在, 直接开始机器学习实验\n",
                        "acc=0.8259, precision=0.8359, recall=0.8297, f1=0.8255\n",
                        "----------------------------------------------------------------------------------------------------------\n",
                        "K = 25\n",
                        "匿名化数据已存在, 直接开始机器学习实验\n",
                        "acc=0.7716, precision=0.7741, recall=0.7738, f1=0.7715\n",
                        "----------------------------------------------------------------------------------------------------------\n",
                        "K = 30\n",
                        "匿名化数据已存在, 直接开始机器学习实验\n",
                        "acc=0.7510, precision=0.7519, recall=0.7515, f1=0.7510\n",
                        "----------------------------------------------------------------------------------------------------------\n",
                        "K = 35\n",
                        "匿名化数据已存在, 直接开始机器学习实验\n",
                        "acc=0.7056, precision=0.7032, recall=0.7050, f1=0.7036\n",
                        "----------------------------------------------------------------------------------------------------------\n",
                        "K = 40\n",
                        "匿名化数据已存在, 直接开始机器学习实验\n",
                        "acc=0.7510, precision=0.7519, recall=0.7515, f1=0.7510\n",
                        "----------------------------------------------------------------------------------------------------------\n",
                        "K = 45\n",
                        "匿名化数据已存在, 直接开始机器学习实验\n",
                        "acc=0.7671, precision=0.7676, recall=0.7665, f1=0.7666\n",
                        "----------------------------------------------------------------------------------------------------------\n",
                        "K = 50\n",
                        "匿名化数据已存在, 直接开始机器学习实验\n",
                        "acc=0.7149, precision=0.7439, recall=0.7182, f1=0.7081\n",
                        "----------------------------------------------------------------------------------------------------------\n",
                        "K = 55\n",
                        "匿名化数据已存在, 直接开始机器学习实验\n",
                        "acc=0.7189, precision=0.7190, recall=0.7191, f1=0.7189\n",
                        "----------------------------------------------------------------------------------------------------------\n",
                        "K = 60\n",
                        "匿名化数据已存在, 直接开始机器学习实验\n",
                        "acc=0.7068, precision=0.7068, recall=0.7065, f1=0.7065\n",
                        "----------------------------------------------------------------------------------------------------------\n",
                        "K = 65\n",
                        "匿名化数据已存在, 直接开始机器学习实验\n",
                        "acc=0.7108, precision=0.7173, recall=0.7090, f1=0.7074\n",
                        "----------------------------------------------------------------------------------------------------------\n",
                        "K = 70\n",
                        "匿名化数据已存在, 直接开始机器学习实验\n",
                        "acc=0.7068, precision=0.7073, recall=0.7061, f1=0.7061\n",
                        "----------------------------------------------------------------------------------------------------------\n",
                        "K = 75\n",
                        "匿名化数据已存在, 直接开始机器学习实验\n",
                        "acc=0.8116, precision=0.8118, recall=0.8118, f1=0.8116\n",
                        "----------------------------------------------------------------------------------------------------------\n",
                        "K = 80\n",
                        "匿名化数据已存在, 直接开始机器学习实验\n",
                        "acc=0.6867, precision=0.6971, recall=0.6889, f1=0.6841\n",
                        "----------------------------------------------------------------------------------------------------------\n",
                        "K = 85\n",
                        "匿名化数据已存在, 直接开始机器学习实验\n",
                        "acc=0.6466, precision=0.6545, recall=0.6440, f1=0.6395\n",
                        "----------------------------------------------------------------------------------------------------------\n",
                        "K = 90\n",
                        "匿名化数据已存在, 直接开始机器学习实验\n",
                        "acc=0.8333, precision=0.8443, recall=0.8379, f1=0.8330\n",
                        "----------------------------------------------------------------------------------------------------------\n",
                        "K = 95\n",
                        "匿名化数据已存在, 直接开始机器学习实验\n",
                        "acc=0.6798, precision=0.6859, recall=0.6790, f1=0.6765\n",
                        "----------------------------------------------------------------------------------------------------------\n",
                        "K = 100\n",
                        "匿名化数据已存在, 直接开始机器学习实验\n",
                        "acc=0.6426, precision=0.6440, recall=0.6412, f1=0.6402\n",
                        "----------------------------------------------------------------------------------------------------------\n",
                        "CPU times: user 3.4 s, sys: 29.6 ms, total: 3.43 s\n",
                        "Wall time: 3.41 s\n"
                    ]
                }
            ],
            "source": [
                "%%time\n",
                "%run main.py --dataset mgm --anonymity_method oka --model svm --experiment Y "
            ]
        },
        {
            "cell_type": "code",
            "execution_count": 15,
            "metadata": {},
            "outputs": [
                {
                    "name": "stdout",
                    "output_type": "stream",
                    "text": [
                        "----------------------------------------------------------------------------------------------------------\n",
                        "Namespace(anonymity=50, anonymity_method='oka', dataset='mgm', experiment='Y', model='gbt')\n",
                        "----------------------------------------------------------------------------------------------------------\n"
                    ]
                },
                {
                    "name": "stdout",
                    "output_type": "stream",
                    "text": [
                        "GradientBoostingClassifier(learning_rate=1.0, max_depth=1, random_state=0)\n",
                        "baseline: acc=0.8514, precision=0.8570, recall=0.8501, f1=0.8504\n",
                        "----------------------------------------------------------------------------------------------------------\n",
                        "K = 2\n",
                        "匿名化数据已存在, 直接开始机器学习实验\n",
                        "acc=0.8434, precision=0.8440, recall=0.8429, f1=0.8431\n",
                        "----------------------------------------------------------------------------------------------------------\n",
                        "K = 5\n",
                        "匿名化数据已存在, 直接开始机器学习实验\n",
                        "acc=0.7992, precision=0.7997, recall=0.7996, f1=0.7992\n",
                        "----------------------------------------------------------------------------------------------------------\n",
                        "K = 10\n",
                        "匿名化数据已存在, 直接开始机器学习实验\n",
                        "acc=0.8160, precision=0.8158, recall=0.8168, f1=0.8158\n",
                        "----------------------------------------------------------------------------------------------------------\n",
                        "K = 15\n",
                        "匿名化数据已存在, 直接开始机器学习实验\n",
                        "acc=0.7837, precision=0.7802, recall=0.7821, f1=0.7810\n",
                        "----------------------------------------------------------------------------------------------------------\n",
                        "K = 20\n",
                        "匿名化数据已存在, 直接开始机器学习实验\n",
                        "acc=0.8259, precision=0.8359, recall=0.8297, f1=0.8255\n",
                        "----------------------------------------------------------------------------------------------------------\n",
                        "K = 25\n",
                        "匿名化数据已存在, 直接开始机器学习实验\n",
                        "acc=0.7716, precision=0.7741, recall=0.7738, f1=0.7715\n",
                        "----------------------------------------------------------------------------------------------------------\n",
                        "K = 30\n",
                        "匿名化数据已存在, 直接开始机器学习实验\n",
                        "acc=0.7631, precision=0.7631, recall=0.7632, f1=0.7630\n",
                        "----------------------------------------------------------------------------------------------------------\n",
                        "K = 35\n",
                        "匿名化数据已存在, 直接开始机器学习实验\n",
                        "acc=0.7056, precision=0.7032, recall=0.7050, f1=0.7036\n",
                        "----------------------------------------------------------------------------------------------------------\n",
                        "K = 40\n",
                        "匿名化数据已存在, 直接开始机器学习实验\n",
                        "acc=0.7671, precision=0.7705, recall=0.7658, f1=0.7657\n",
                        "----------------------------------------------------------------------------------------------------------\n",
                        "K = 45\n",
                        "匿名化数据已存在, 直接开始机器学习实验\n",
                        "acc=0.7390, precision=0.7401, recall=0.7396, f1=0.7389\n",
                        "----------------------------------------------------------------------------------------------------------\n",
                        "K = 50\n",
                        "匿名化数据已存在, 直接开始机器学习实验\n",
                        "acc=0.7149, precision=0.7439, recall=0.7182, f1=0.7081\n",
                        "----------------------------------------------------------------------------------------------------------\n",
                        "K = 55\n",
                        "匿名化数据已存在, 直接开始机器学习实验\n",
                        "acc=0.7189, precision=0.7190, recall=0.7191, f1=0.7189\n",
                        "----------------------------------------------------------------------------------------------------------\n",
                        "K = 60\n",
                        "匿名化数据已存在, 直接开始机器学习实验\n",
                        "acc=0.6948, precision=0.6982, recall=0.6959, f1=0.6942\n",
                        "----------------------------------------------------------------------------------------------------------\n",
                        "K = 65\n",
                        "匿名化数据已存在, 直接开始机器学习实验\n",
                        "acc=0.7108, precision=0.7173, recall=0.7090, f1=0.7074\n",
                        "----------------------------------------------------------------------------------------------------------\n",
                        "K = 70\n",
                        "匿名化数据已存在, 直接开始机器学习实验\n",
                        "acc=0.7068, precision=0.7073, recall=0.7061, f1=0.7061\n",
                        "----------------------------------------------------------------------------------------------------------\n",
                        "K = 75\n",
                        "匿名化数据已存在, 直接开始机器学习实验\n",
                        "acc=0.8116, precision=0.8118, recall=0.8118, f1=0.8116\n",
                        "----------------------------------------------------------------------------------------------------------\n",
                        "K = 80\n",
                        "匿名化数据已存在, 直接开始机器学习实验\n",
                        "acc=0.6867, precision=0.6971, recall=0.6889, f1=0.6841\n",
                        "----------------------------------------------------------------------------------------------------------\n",
                        "K = 85\n",
                        "匿名化数据已存在, 直接开始机器学习实验\n",
                        "acc=0.6466, precision=0.6545, recall=0.6440, f1=0.6395\n",
                        "----------------------------------------------------------------------------------------------------------\n",
                        "K = 90\n",
                        "匿名化数据已存在, 直接开始机器学习实验\n",
                        "acc=0.8333, precision=0.8443, recall=0.8379, f1=0.8330\n",
                        "----------------------------------------------------------------------------------------------------------\n",
                        "K = 95\n",
                        "匿名化数据已存在, 直接开始机器学习实验\n",
                        "acc=0.6798, precision=0.6859, recall=0.6790, f1=0.6765\n",
                        "----------------------------------------------------------------------------------------------------------\n",
                        "K = 100\n",
                        "匿名化数据已存在, 直接开始机器学习实验\n",
                        "acc=0.6506, precision=0.6546, recall=0.6520, f1=0.6495\n",
                        "----------------------------------------------------------------------------------------------------------\n",
                        "CPU times: user 6.82 s, sys: 26 ms, total: 6.84 s\n",
                        "Wall time: 6.83 s\n"
                    ]
                }
            ],
            "source": [
                "%%time\n",
                "%run main.py --dataset mgm --anonymity_method oka --model gbt --experiment Y "
            ]
        }
    ],
    "metadata": {
        "kernelspec": {
            "display_name": "hhj",
            "language": "python",
            "name": "hhj"
        },
        "language_info": {
            "codemirror_mode": {
                "name": "ipython",
                "version": 3
            },
            "file_extension": ".py",
            "mimetype": "text/x-python",
            "name": "python",
            "nbconvert_exporter": "python",
            "pygments_lexer": "ipython3",
            "version": "3.8.18"
        }
    },
    "nbformat": 4,
    "nbformat_minor": 2
}
